package com.example.xlmkotlinwanandroid.network

import retrofit2.Call
import retrofit2.Callback
import retrofit2.Response
import java.lang.RuntimeException
import kotlin.coroutines.resume
import kotlin.coroutines.resumeWithException
import kotlin.coroutines.suspendCoroutine

object Network {
    //定义抽象方法
    val apiService = ServiceCreator.create(ApiService::class.java)

    //定义首页article获取
    suspend fun getArticleList(pageNo: Int) = apiService.getArticleList(pageNo)

    //获取轮播图
    suspend fun getBannerList() = apiService.getBannerList()

    //获取项目类别
    suspend fun getProjectCategory() = apiService.getProjectCategory()

    //项目按类别获取
    suspend fun getProjectArticleByType(pageNo: Int, cid: Int) =
        apiService.getProjecDataByType(pageNo, cid);
}